package atomic;

import java.util.concurrent.atomic.AtomicIntegerArray;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

/**
 * @Classname Incrementer
 * @Description TODO
 * @Date 2024/2/3 20:34
 * @Author zhuzhenguo
 */
class Incrementer implements Runnable {
    private AtomicIntegerArray array;

    public Incrementer(AtomicIntegerArray array) {
        this.array = array;
    }

    @Override
    public void run() {
        for (int i = 0; i < array.length(); i++) {
            array.getAndIncrement(i);
        }
    }
}
